<?php

namespace app\common\exception;
use app\common\enum\ErrorCodeEnum;
use app\common\enum\HttpCodeEnum;

/**
 * 通用参数类异常错误
 */
class ParameterException extends BaseException {

    public function __construct(array $params = [])
    {
        $this->code = isset($params['code']) && $params['code'] ? $params['code'] : HttpCodeEnum::CODE_400;
        $this->msg = isset($params['msg']) && $params['msg'] ? $params['msg'] : '参数不全.';
        $this->error_code = isset($params['error_code']) && $params['error_code'] ? $params['error_code'] : ErrorCodeEnum::PARAMETER;
        //$this->content = isset($params['content']) && $params['content'] ? $params['content'] : '';
        parent::__construct($params);
    }
}